Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cases] Cases assignees sub feature #201654

Merged
merged 58 commits into from
Jan 30, 2025

Conversation

kqualters-elastic
Copy link
Contributor

@kqualters-elastic kqualters-elastic commented Nov 25, 2024

Summary

This pr implements a new cases assignee sub-feature, allowing users to control a role's ability to change the assignee of a case. With the permission enabled, they can assign any user to any case, with it disabled, the assignees component is hidden.

Read only + enabled:
image

All + assign disabled:
image

Checklist

@kqualters-elastic kqualters-elastic added Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v9.0.0 release_note:feature Makes this part of the condensed release notes Team:Threat Hunting:Investigations Security Solution Investigations Team v8.18.0 labels Nov 25, 2024
@kqualters-elastic kqualters-elastic changed the title [WIP] [Cases] Cases assignees [Cases] Cases assignees sub feature Dec 12, 2024
@kqualters-elastic kqualters-elastic marked this pull request as ready for review December 12, 2024 22:03
@kqualters-elastic kqualters-elastic requested review from a team as code owners December 12, 2024 22:03
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-threat-hunting-investigations (Team:Threat Hunting:Investigations)

@kqualters-elastic kqualters-elastic added the backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) label Dec 12, 2024
@botelastic botelastic bot added the ci:project-deploy-observability Create an Observability project label Dec 12, 2024
@kqualters-elastic kqualters-elastic enabled auto-merge (squash) January 30, 2025 16:03
@kqualters-elastic kqualters-elastic merged commit 0e7c608 into elastic:main Jan 30, 2025
9 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/13056276893

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.x Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 201654

Questions ?

Please refer to the Backport tool documentation

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Feb 3, 2025
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 201654 locally

@kobelb
Copy link
Contributor

kobelb commented Feb 3, 2025

I just updated the labels on this PR. It didn't merge before the 9.0/8.18 feature freeze, and the backport to 8.x failed. Right now, this change will only be included in 9.1. I'm assuming that we'll be fixing the backport, so I added the 8.19 label.

@kqualters-elastic
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.18

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

@kqualters-elastic
Copy link
Contributor Author

💔 Some backports could not be created

Status Branch Result
9.0 Cherrypick failed because the selected commit (0e7c608) is empty. Did you already backport this commit?
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

node scripts/backport --pr 201654

Questions ?

Please refer to the Backport tool documentation

kqualters-elastic added a commit to kqualters-elastic/kibana that referenced this pull request Feb 4, 2025
## Summary

This pr implements a new cases assignee sub-feature, allowing users to
control a role's ability to change the assignee of a case. With the
permission enabled, they can assign any user to any case, with it
disabled, the assignees component is hidden.

Read only + enabled:

![image](https://github.com/user-attachments/assets/ba421784-d976-4ae9-a399-e404c26b3842)

All + assign disabled:

![image](https://github.com/user-attachments/assets/d835b6f9-5a14-4ae0-abed-b3c3252c2692)

### Checklist

- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Elastic Machine <[email protected]>
(cherry picked from commit 0e7c608)

# Conflicts:
#	x-pack/platform/plugins/shared/cases/server/client/cases/bulk_update.test.ts
#	x-pack/platform/plugins/shared/features/server/__snapshots__/oss_features.test.ts.snap
#	x-pack/test/api_integration/apis/cases/common/roles.ts
#	x-pack/test/api_integration/apis/cases/common/users.ts
#	x-pack/test/api_integration/apis/cases/privileges.ts
#	x-pack/test/security_api_integration/tests/features/deprecated_features.ts
#	x-pack/test/spaces_api_integration/common/suites/get.ts
@kqualters-elastic
Copy link
Contributor Author

@kobelb I think it made it in to 9.0 bc1, but not 8.18: https://github.com/elastic/kibana/commits/fd1f8b62137f14e93716e298e4e931b576e2ca13 for 9.0 vs
https://github.com/elastic/kibana/commits/33e6754d67870b0e403266b752c3973539506cc6 for 8.18 (and as the backport above is still open). The 8.18 backport in particular gave me a bunch of issues locally, and now is failing on buildkite with an error that seems completely unrelated:

ERROR Failed to capture OAS: {
--
  | "errno": -28,
  | "code": "ENOSPC",
  | "syscall": "mkdir",
  | "path": "/opt/buildkite-agent/builds/bk-agent-prod-gcp-1738636880036796160/elastic/kibana-pull-request/kibana/.es/es-test-cluster/ES_TMPDIR"
  | }
  | ERROR UNHANDLED ERROR
  | ERROR Error: ENOSPC: no space left on device, mkdir '/opt/buildkite-agent/builds/bk-agent-prod-gcp-1738636880036796160/elastic/kibana-pull-request/kibana/.es/es-test-cluster/ES_TMPDIR'

I think it would be ok to include in 8.18 BC2 as long as CI passes eventually, given that it's in 9.0 already, but if anyone disagrees I can close it.

@kobelb kobelb added v9.0.0 and removed v9.1.0 labels Feb 4, 2025
@kobelb
Copy link
Contributor

kobelb commented Feb 4, 2025

@kobelb I think it made it in to 9.0 bc1, but not 8.18: https://github.com/elastic/kibana/commits/fd1f8b62137f14e93716e298e4e931b576e2ca13 for 9.0 vs
https://github.com/elastic/kibana/commits/33e6754d67870b0e403266b752c3973539506cc6 for 8.18 (and as the backport above is still open).

You are correct, apologies. Added you to a slack thread where we're weighing the risk vs benefit regarding which 8.x release we are comfortable backporting this to.

kqualters-elastic added a commit to kqualters-elastic/kibana that referenced this pull request Feb 5, 2025
This pr implements a new cases assignee sub-feature, allowing users to
control a role's ability to change the assignee of a case. With the
permission enabled, they can assign any user to any case, with it
disabled, the assignees component is hidden.

Read only + enabled:

![image](https://github.com/user-attachments/assets/ba421784-d976-4ae9-a399-e404c26b3842)

All + assign disabled:

![image](https://github.com/user-attachments/assets/d835b6f9-5a14-4ae0-abed-b3c3252c2692)

- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Elastic Machine <[email protected]>
kqualters-elastic added a commit to kqualters-elastic/kibana that referenced this pull request Feb 5, 2025
This pr implements a new cases assignee sub-feature, allowing users to
control a role's ability to change the assignee of a case. With the
permission enabled, they can assign any user to any case, with it
disabled, the assignees component is hidden.

Read only + enabled:

![image](https://github.com/user-attachments/assets/ba421784-d976-4ae9-a399-e404c26b3842)

All + assign disabled:

![image](https://github.com/user-attachments/assets/d835b6f9-5a14-4ae0-abed-b3c3252c2692)

- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Elastic Machine <[email protected]>
kqualters-elastic added a commit to kqualters-elastic/kibana that referenced this pull request Feb 5, 2025
This pr implements a new cases assignee sub-feature, allowing users to
control a role's ability to change the assignee of a case. With the
permission enabled, they can assign any user to any case, with it
disabled, the assignees component is hidden.

Read only + enabled:

![image](https://github.com/user-attachments/assets/ba421784-d976-4ae9-a399-e404c26b3842)

All + assign disabled:

![image](https://github.com/user-attachments/assets/d835b6f9-5a14-4ae0-abed-b3c3252c2692)

- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Elastic Machine <[email protected]>
kqualters-elastic added a commit to kqualters-elastic/kibana that referenced this pull request Feb 5, 2025
This pr implements a new cases assignee sub-feature, allowing users to
control a role's ability to change the assignee of a case. With the
permission enabled, they can assign any user to any case, with it
disabled, the assignees component is hidden.

Read only + enabled:

![image](https://github.com/user-attachments/assets/ba421784-d976-4ae9-a399-e404c26b3842)

All + assign disabled:

![image](https://github.com/user-attachments/assets/d835b6f9-5a14-4ae0-abed-b3c3252c2692)

- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Elastic Machine <[email protected]>
@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

kqualters-elastic added a commit that referenced this pull request Feb 5, 2025
# Backport

This will backport the following commits from `main` to `8.x`:
- [[Cases] Cases assignees sub feature
(#201654)](#201654)
- [[Cases] Fix an issue with the reopen case permission, add integration
tests for failing case
(#201517)](#201517)

<!--- Backport version: 9.6.4 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Kevin
Qualters","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-30T16:04:38Z","message":"[Cases]
Cases assignees sub feature (#201654)\n\n## Summary\r\n\r\nThis pr
implements a new cases assignee sub-feature, allowing users
to\r\ncontrol a role's ability to change the assignee of a case. With
the\r\npermission enabled, they can assign any user to any case, with
it\r\ndisabled, the assignees component is hidden.\r\n\r\nRead only +
enabled:\r\n\r\n![image](https://github.com/user-attachments/assets/ba421784-d976-4ae9-a399-e404c26b3842)\r\n\r\n\r\nAll
+ assign
disabled:\r\n\r\n![image](https://github.com/user-attachments/assets/d835b6f9-5a14-4ae0-abed-b3c3252c2692)\r\n\r\n\r\n\r\n###
Checklist\r\n\r\n- [
]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [x] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"0e7c608ed3d62852b72eaf45e65e347a03bd08d6","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:ResponseOps","backport
missing","release_note:feature","Team:Threat
Hunting:Investigations","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-management","v9.1.0","v8.19.0"],"title":"[Cases]
Cases assignees sub
feature","number":201654,"url":"https://github.com/elastic/kibana/pull/201654","mergeCommit":{"message":"[Cases]
Cases assignees sub feature (#201654)\n\n## Summary\r\n\r\nThis pr
implements a new cases assignee sub-feature, allowing users
to\r\ncontrol a role's ability to change the assignee of a case. With
the\r\npermission enabled, they can assign any user to any case, with
it\r\ndisabled, the assignees component is hidden.\r\n\r\nRead only +
enabled:\r\n\r\n![image](https://github.com/user-attachments/assets/ba421784-d976-4ae9-a399-e404c26b3842)\r\n\r\n\r\nAll
+ assign
disabled:\r\n\r\n![image](https://github.com/user-attachments/assets/d835b6f9-5a14-4ae0-abed-b3c3252c2692)\r\n\r\n\r\n\r\n###
Checklist\r\n\r\n- [
]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [x] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"0e7c608ed3d62852b72eaf45e65e347a03bd08d6"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"url":"https://github.com/elastic/kibana/pull/209435","number":209435,"branch":"8.18","state":"OPEN"}]}]
BACKPORT-->

---------

Co-authored-by: Elastic Machine <[email protected]>
kqualters-elastic added a commit that referenced this pull request Feb 5, 2025
# Backport

This will backport the following commits from `main` to `8.18`:
- [[Cases] Cases assignees sub feature
(#201654)](#201654)
- [[Cases] Fix an issue with the reopen case permission, add integration
tests for failing case
(#201517)](#201517)

<!--- Backport version: 9.6.4 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Kevin
Qualters","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-30T16:04:38Z","message":"[Cases]
Cases assignees sub feature (#201654)\n\n## Summary\r\n\r\nThis pr
implements a new cases assignee sub-feature, allowing users
to\r\ncontrol a role's ability to change the assignee of a case. With
the\r\npermission enabled, they can assign any user to any case, with
it\r\ndisabled, the assignees component is hidden.\r\n\r\nRead only +
enabled:\r\n\r\n![image](https://github.com/user-attachments/assets/ba421784-d976-4ae9-a399-e404c26b3842)\r\n\r\n\r\nAll
+ assign
disabled:\r\n\r\n![image](https://github.com/user-attachments/assets/d835b6f9-5a14-4ae0-abed-b3c3252c2692)\r\n\r\n\r\n\r\n###
Checklist\r\n\r\n- [
]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [x] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"0e7c608ed3d62852b72eaf45e65e347a03bd08d6","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:ResponseOps","v9.0.0","release_note:feature","Team:Threat
Hunting:Investigations","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-management","v8.18.0"],"title":"[Cases]
Cases assignees sub
feature","number":201654,"url":"https://github.com/elastic/kibana/pull/201654","mergeCommit":{"message":"[Cases]
Cases assignees sub feature (#201654)\n\n## Summary\r\n\r\nThis pr
implements a new cases assignee sub-feature, allowing users
to\r\ncontrol a role's ability to change the assignee of a case. With
the\r\npermission enabled, they can assign any user to any case, with
it\r\ndisabled, the assignees component is hidden.\r\n\r\nRead only +
enabled:\r\n\r\n![image](https://github.com/user-attachments/assets/ba421784-d976-4ae9-a399-e404c26b3842)\r\n\r\n\r\nAll
+ assign
disabled:\r\n\r\n![image](https://github.com/user-attachments/assets/d835b6f9-5a14-4ae0-abed-b3c3252c2692)\r\n\r\n\r\n\r\n###
Checklist\r\n\r\n- [
]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [x] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"0e7c608ed3d62852b72eaf45e65e347a03bd08d6"}},"sourceBranch":"main","suggestedTargetBranches":["8.18"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201654","number":201654,"mergeCommit":{"message":"[Cases]
Cases assignees sub feature (#201654)\n\n## Summary\r\n\r\nThis pr
implements a new cases assignee sub-feature, allowing users
to\r\ncontrol a role's ability to change the assignee of a case. With
the\r\npermission enabled, they can assign any user to any case, with
it\r\ndisabled, the assignees component is hidden.\r\n\r\nRead only +
enabled:\r\n\r\n![image](https://github.com/user-attachments/assets/ba421784-d976-4ae9-a399-e404c26b3842)\r\n\r\n\r\nAll
+ assign
disabled:\r\n\r\n![image](https://github.com/user-attachments/assets/d835b6f9-5a14-4ae0-abed-b3c3252c2692)\r\n\r\n\r\n\r\n###
Checklist\r\n\r\n- [
]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [x] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"0e7c608ed3d62852b72eaf45e65e347a03bd08d6"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: Elastic Machine <[email protected]>
@kibanamachine kibanamachine added v8.18.0 and removed backport missing Added to PRs automatically when the are determined to be missing a backport. labels Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) ci:project-deploy-observability Create an Observability project release_note:feature Makes this part of the condensed release notes Team:obs-ux-management Observability Management User Experience Team Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) Team:Threat Hunting:Investigations Security Solution Investigations Team v8.18.0 v8.19.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.